\(\int \frac {1}{\sqrt {1-x} (1+x)} \, dx\) [926]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 23 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1-x}}{\sqrt {2}}\right ) \]

[Out]

-arctanh(1/2*(1-x)^(1/2)*2^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {65, 212} \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1-x}}{\sqrt {2}}\right ) \]

[In]

Int[1/(Sqrt[1 - x]*(1 + x)),x]

[Out]

-(Sqrt[2]*ArcTanh[Sqrt[1 - x]/Sqrt[2]])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = -\left (2 \text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\sqrt {1-x}\right )\right ) \\ & = -\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {1-x}}{\sqrt {2}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1-x}}{\sqrt {2}}\right ) \]

[In]

Integrate[1/(Sqrt[1 - x]*(1 + x)),x]

[Out]

-(Sqrt[2]*ArcTanh[Sqrt[1 - x]/Sqrt[2]])

Maple [A] (verified)

Time = 2.21 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83

method result size
derivativedivides \(-\operatorname {arctanh}\left (\frac {\sqrt {1-x}\, \sqrt {2}}{2}\right ) \sqrt {2}\) \(19\)
default \(-\operatorname {arctanh}\left (\frac {\sqrt {1-x}\, \sqrt {2}}{2}\right ) \sqrt {2}\) \(19\)
pseudoelliptic \(-\operatorname {arctanh}\left (\frac {\sqrt {1-x}\, \sqrt {2}}{2}\right ) \sqrt {2}\) \(19\)
trager \(-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) \ln \left (-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x -3 \operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right )-4 \sqrt {1-x}}{1+x}\right )}{2}\) \(43\)

[In]

int(1/(1+x)/(1-x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-arctanh(1/2*(1-x)^(1/2)*2^(1/2))*2^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.45 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (\frac {x + 2 \, \sqrt {2} \sqrt {-x + 1} - 3}{x + 1}\right ) \]

[In]

integrate(1/(1+x)/(1-x)^(1/2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*log((x + 2*sqrt(2)*sqrt(-x + 1) - 3)/(x + 1))

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.52 (sec) , antiderivative size = 46, normalized size of antiderivative = 2.00 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=\begin {cases} - \sqrt {2} \operatorname {acosh}{\left (\frac {\sqrt {2}}{\sqrt {x + 1}} \right )} & \text {for}\: \frac {1}{\left |{x + 1}\right |} > \frac {1}{2} \\\sqrt {2} i \operatorname {asin}{\left (\frac {\sqrt {2}}{\sqrt {x + 1}} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(1+x)/(1-x)**(1/2),x)

[Out]

Piecewise((-sqrt(2)*acosh(sqrt(2)/sqrt(x + 1)), 1/Abs(x + 1) > 1/2), (sqrt(2)*I*asin(sqrt(2)/sqrt(x + 1)), Tru
e))

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.48 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \sqrt {-x + 1}}{\sqrt {2} + \sqrt {-x + 1}}\right ) \]

[In]

integrate(1/(1+x)/(1-x)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(2)*log(-(sqrt(2) - sqrt(-x + 1))/(sqrt(2) + sqrt(-x + 1)))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (18) = 36\).

Time = 0.26 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.65 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=-\frac {1}{2} \, \sqrt {2} \log \left (\sqrt {2} + \sqrt {-x + 1}\right ) + \frac {1}{2} \, \sqrt {2} \log \left ({\left | -\sqrt {2} + \sqrt {-x + 1} \right |}\right ) \]

[In]

integrate(1/(1+x)/(1-x)^(1/2),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*log(sqrt(2) + sqrt(-x + 1)) + 1/2*sqrt(2)*log(abs(-sqrt(2) + sqrt(-x + 1)))

Mupad [B] (verification not implemented)

Time = 11.93 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.78 \[ \int \frac {1}{\sqrt {1-x} (1+x)} \, dx=-\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {1-x}}{2}\right ) \]

[In]

int(1/((1 - x)^(1/2)*(x + 1)),x)

[Out]

-2^(1/2)*atanh((2^(1/2)*(1 - x)^(1/2))/2)